/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * verHorario.java
 *
 * Created on 20-abr-2011, 3:39:52
 */

package interfaces;

import GestorUsuarios.IDException;
import GestorUsuarios.Usuario;
import Controlador.*;
import GestorClinico.DiaSemana;
import GestorClinico.HoraTrabajo;
import GestorUsuarios.PersonalClinica;
import clinica.ClinicaView;
import clinica.Interfaces;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import org.jdesktop.application.Action;

/**
 *
 * @author Victor
 */
public class modificarHorario extends javax.swing.JPanel {

    private ClinicaView app;
    private Interfaces anterior;
    private Usuario usu;
    private ActionListener manejador;

    /** Creates new form verHorario */
    public modificarHorario(ClinicaView a) {
        app = a;
        initComponents();
        botones = new JToggleButton[7*12];

        horas = new boolean[2*7*12];

        manejador = new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    int i = Integer.parseInt(evt.getActionCommand());
                    if(!en_am)
                        i = i + 7*12;
                    horas[i] = !horas[i];
                }
            };

        for(int i=0;i<7*12;i++) {
            botones[i] = new JToggleButton();
            botones[i].setActionCommand(""+i);
            botones[i].addActionListener(manejador);
        }

        for(int i=0;i<7*12;i++)
            panelhoras.add(botones[i]);


        en_am = true;
    }

    public void rellenaDatos(Usuario u, Interfaces ant) throws NoSuchAlgorithmException, IOException, ClassNotFoundException {
        en_am = true;
        anterior = ant;
        usu = u;
        horario = Controlador.miHorario(u.getIdUsuario());

        for(int i=0;i<2*7*12;i++)
            horas[i] = false;

        if(horario!=null)
        for(HoraTrabajo h:horario) {
            int valSemana = 0;
            switch(h.getDiaSemana()) {
                case LUNES:
                    valSemana = 0;
                    break;
                case MARTES:
                    valSemana = 1;
                    break;
                case MIERCOLES:
                    valSemana = 2;
                    break;
                case JUEVES:
                    valSemana = 3;
                    break;
                case VIERNES:
                    valSemana = 4;
                    break;
                case SABADO:
                    valSemana = 5;
                    break;
                case DOMINGO:
                    valSemana = 6;
                    break;
            }

            if (Integer.parseInt(h.getHoraInicio()) < 12)
                horas[Integer.parseInt(h.getHoraInicio()) * 7 + valSemana] = true;

            if (Integer.parseInt(h.getHoraInicio()) >= 12)
                horas[(Integer.parseInt(h.getHoraInicio())-12) * 7 + valSemana + 7*12] = true;
        }


        setColoreado();
    }

    public void setColoreado() {
		
                if(en_am==true) {
                    hora0.setText("00:00");
                    hora1.setText("01:00");
                    hora2.setText("02:00");
                    hora3.setText("03:00");
                    hora4.setText("04:00");
                    hora5.setText("05:00");
                    hora6.setText("06:00");
                    hora7.setText("07:00");
                    hora8.setText("08:00");
                    hora9.setText("09:00");
                    hora10.setText("10:00");
                    hora11.setText("11:00");

                    for(int i=0;i<7*12;i++)
                        botones[i].setSelected(horas[i]);

                } else {
                    hora0.setText("12:00");
                    hora1.setText("13:00");
                    hora2.setText("14:00");
                    hora3.setText("15:00");
                    hora4.setText("16:00");
                    hora5.setText("17:00");
                    hora6.setText("18:00");
                    hora7.setText("19:00");
                    hora8.setText("20:00");
                    hora9.setText("21:00");
                    hora10.setText("22:00");
                    hora11.setText("23:00");

                    for(int i=0;i<7*12;i++)
                        botones[i].setSelected(horas[i+7*12]);
                }
	}

	public HoraTrabajo [] getHorasSeleccionadas() {
		int tam = 2*7*12;
		ArrayList<HoraTrabajo> array_horas = new ArrayList<HoraTrabajo>();
		for(int i=0;i<tam;i++) {
			if(horas[i]) {
				DiaSemana dia = DiaSemana.LUNES;
				switch (i%7) {
				case 0:
					dia = DiaSemana.LUNES;
					break;
				case 1:
					dia = DiaSemana.MARTES;
					break;
				case 2:
					dia = DiaSemana.MIERCOLES;
					break;
				case 3:
					dia = DiaSemana.JUEVES;
					break;
				case 4:
					dia = DiaSemana.VIERNES;
					break;
				case 5:
					dia = DiaSemana.SABADO;
					break;
				case 6:
					dia = DiaSemana.DOMINGO;
					break;
				}

				long hora = 0;
				if(i<7*12)
					hora = i/7;
				else
					hora = (i-7*12)/7;



				if(i<7*12) {// De mañana
					array_horas.add(new HoraTrabajo(0,""+hora,dia));
				} else {
					array_horas.add(new HoraTrabajo(0,""+(hora+12),dia));
				}
			}
		}


		if(array_horas.size()>0) {
			HoraTrabajo [] horatrabaj = new HoraTrabajo[array_horas.size()];
			array_horas.toArray(horatrabaj);
			return horatrabaj;
		} else return null;
	}

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelhoras = new javax.swing.JPanel();
        aceptar = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        Miercoles = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        Jueves = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        hora0 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        hora1 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        hora2 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        hora3 = new javax.swing.JLabel();
        jPanel14 = new javax.swing.JPanel();
        hora4 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        hora5 = new javax.swing.JLabel();
        jPanel16 = new javax.swing.JPanel();
        hora6 = new javax.swing.JLabel();
        jPanel17 = new javax.swing.JPanel();
        hora7 = new javax.swing.JLabel();
        jPanel18 = new javax.swing.JPanel();
        hora8 = new javax.swing.JLabel();
        jPanel19 = new javax.swing.JPanel();
        hora9 = new javax.swing.JLabel();
        jPanel20 = new javax.swing.JPanel();
        hora10 = new javax.swing.JLabel();
        jPanel21 = new javax.swing.JPanel();
        hora11 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        setMinimumSize(new java.awt.Dimension(300, 300));
        setName("Form"); // NOI18N

        panelhoras.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        panelhoras.setName("panelhoras"); // NOI18N
        panelhoras.setLayout(new java.awt.GridLayout(12, 7));

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(modificarHorario.class, this);
        aceptar.setAction(actionMap.get("aceptar")); // NOI18N
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(modificarHorario.class);
        aceptar.setFont(resourceMap.getFont("aceptar.font")); // NOI18N
        aceptar.setIcon(resourceMap.getIcon("aceptar.icon")); // NOI18N
        aceptar.setText(resourceMap.getString("aceptar.text")); // NOI18N
        aceptar.setName("aceptar"); // NOI18N
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });

        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(new java.awt.GridLayout(1, 7));

        jPanel2.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel2.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel2);

        jPanel3.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel3.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel2.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel2.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel2.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel2.setName("jLabel2"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel3);

        jPanel4.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel4.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        Miercoles.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        Miercoles.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        Miercoles.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        Miercoles.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Miercoles.setText(resourceMap.getString("Miercoles.text")); // NOI18N
        Miercoles.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        Miercoles.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        Miercoles.setName("Miercoles"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(Miercoles, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(Miercoles, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel4);

        jPanel5.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel5.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        Jueves.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        Jueves.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        Jueves.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        Jueves.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Jueves.setText(resourceMap.getString("Jueves.text")); // NOI18N
        Jueves.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        Jueves.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        Jueves.setName("Jueves"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(Jueves, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(Jueves, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel5);

        jPanel6.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel6.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        jLabel5.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel5.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel5.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel5.setName("jLabel5"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel6);

        jPanel7.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel7.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jLabel6.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel6.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel6.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel6.setName("jLabel6"); // NOI18N

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel7);

        jPanel8.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel8.setForeground(resourceMap.getColor("jPanel8.foreground")); // NOI18N
        jPanel8.setName("jPanel8"); // NOI18N

        jLabel3.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel3.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel3.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel3.setName("jLabel3"); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 97, Short.MAX_VALUE)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 48, Short.MAX_VALUE)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel8);

        jPanel9.setName("jPanel9"); // NOI18N
        jPanel9.setLayout(new java.awt.GridLayout(12, 0));

        jPanel10.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel10.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel10.setName("jPanel10"); // NOI18N

        hora0.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora0.setForeground(resourceMap.getColor("hora0.foreground")); // NOI18N
        hora0.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora0.setText(resourceMap.getString("hora0.text")); // NOI18N
        hora0.setName("hora0"); // NOI18N

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora0, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora0, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel10);

        jPanel11.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel11.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel11.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel11.setName("jPanel11"); // NOI18N

        hora1.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora1.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora1.setText(resourceMap.getString("hora1.text")); // NOI18N
        hora1.setName("hora1"); // NOI18N

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel11);

        jPanel12.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel12.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel12.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel12.setName("jPanel12"); // NOI18N

        hora2.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora2.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora2.setText(resourceMap.getString("hora2.text")); // NOI18N
        hora2.setName("hora2"); // NOI18N

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel12);

        jPanel13.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel13.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel13.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel13.setName("jPanel13"); // NOI18N

        hora3.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora3.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora3.setText(resourceMap.getString("hora3.text")); // NOI18N
        hora3.setName("hora3"); // NOI18N

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel13);

        jPanel14.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel14.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel14.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel14.setName("jPanel14"); // NOI18N

        hora4.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora4.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora4.setText(resourceMap.getString("hora4.text")); // NOI18N
        hora4.setName("hora4"); // NOI18N

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel14);

        jPanel15.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel15.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel15.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel15.setName("jPanel15"); // NOI18N

        hora5.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora5.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora5.setText(resourceMap.getString("hora5.text")); // NOI18N
        hora5.setName("hora5"); // NOI18N

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel15);

        jPanel16.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel16.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel16.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel16.setName("jPanel16"); // NOI18N

        hora6.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora6.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora6.setText(resourceMap.getString("hora6.text")); // NOI18N
        hora6.setName("hora6"); // NOI18N

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel16);

        jPanel17.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel17.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel17.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel17.setName("jPanel17"); // NOI18N

        hora7.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora7.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora7.setText(resourceMap.getString("hora7.text")); // NOI18N
        hora7.setName("hora7"); // NOI18N

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel17);

        jPanel18.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel18.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel18.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel18.setName("jPanel18"); // NOI18N

        hora8.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora8.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora8.setText(resourceMap.getString("hora8.text")); // NOI18N
        hora8.setName("hora8"); // NOI18N

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel18);

        jPanel19.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel19.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel19.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel19.setName("jPanel19"); // NOI18N

        hora9.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora9.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora9.setText(resourceMap.getString("hora9.text")); // NOI18N
        hora9.setName("hora9"); // NOI18N

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel19);

        jPanel20.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel20.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel20.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel20.setName("jPanel20"); // NOI18N

        hora10.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora10.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora10.setText(resourceMap.getString("hora10.text")); // NOI18N
        hora10.setName("hora10"); // NOI18N

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel20);

        jPanel21.setBackground(resourceMap.getColor("jPanel10.background")); // NOI18N
        jPanel21.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel21.setForeground(resourceMap.getColor("jPanel10.foreground")); // NOI18N
        jPanel21.setName("jPanel21"); // NOI18N

        hora11.setFont(resourceMap.getFont("hora0.font")); // NOI18N
        hora11.setForeground(resourceMap.getColor("hora1.foreground")); // NOI18N
        hora11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        hora11.setText(resourceMap.getString("hora11.text")); // NOI18N
        hora11.setName("hora11"); // NOI18N

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 61, Short.MAX_VALUE)
            .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE))
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 22, Short.MAX_VALUE)
            .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(hora11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.add(jPanel21);

        jButton2.setAction(actionMap.get("cambiarFranja")); // NOI18N
        jButton2.setFont(resourceMap.getFont("jButton2.font")); // NOI18N
        jButton2.setIcon(resourceMap.getIcon("jButton2.icon")); // NOI18N
        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N

        jButton1.setAction(actionMap.get("cancelar")); // NOI18N
        jButton1.setIcon(resourceMap.getIcon("jButton1.icon")); // NOI18N
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelhoras, javax.swing.GroupLayout.DEFAULT_SIZE, 683, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 473, Short.MAX_VALUE)
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(aceptar))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 683, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
                    .addComponent(panelhoras, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(aceptar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarActionPerformed

            app.volver(anterior);
}//GEN-LAST:event_aceptarActionPerformed

    @Action
    public void aceptar() throws SQLException, IOException, ClassNotFoundException, IDException, NoSuchAlgorithmException {
        PersonalClinica per = (PersonalClinica)usu;
        per.eliminarHorasTrabajo();
        HoraTrabajo [] todas = HoraTrabajo.getHoraTrabajo();

        HoraTrabajo [] horas = getHorasSeleccionadas();

        if(horas!=null) {
            for(int i=0;i<horas.length;i++)
                horas[i] = HoraTrabajo.getHoraTrabajo(todas,horas[i].getDiaSemana(), horas[i].getHoraInicio());
            per.setHoraTrabajo(horas);
        }

    }

    @Action
    public void cancelar() throws NoSuchAlgorithmException, IOException, ClassNotFoundException, SQLException {
        app.volver(Interfaces.BUSCAR_USUARIOS2);
    }

    @Action
    public void cambiarFranja() {
        en_am = !en_am;
        setColoreado();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Jueves;
    private javax.swing.JLabel Miercoles;
    private javax.swing.JButton aceptar;
    private javax.swing.JLabel hora0;
    private javax.swing.JLabel hora1;
    private javax.swing.JLabel hora10;
    private javax.swing.JLabel hora11;
    private javax.swing.JLabel hora2;
    private javax.swing.JLabel hora3;
    private javax.swing.JLabel hora4;
    private javax.swing.JLabel hora5;
    private javax.swing.JLabel hora6;
    private javax.swing.JLabel hora7;
    private javax.swing.JLabel hora8;
    private javax.swing.JLabel hora9;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel panelhoras;
    // End of variables declaration//GEN-END:variables

    private JToggleButton [] botones;
    private boolean [] horas;
    private HoraTrabajo [] horario;
    private boolean en_am;
}
